/**
 * 静态方法
 * Name = util
 * DateTime = Sat Jan 15 2022 17:18:33 GMT+0800 (中国标准时间)
 * Author = Created by zhj9922
 * FileBasename = util.ts
 * gitee： https://gitee.com/coyeking
 */
 
import { _decorator, Component, Node } from 'cc';

export class util {
    /**
     * obj转string
     * @param obj
     * @returns url
     */
    public static queryParams (obj: any) {
        if (!obj) return '';
        let paramURL = '';
        for (let key in obj) {
            paramURL += `${key}=${obj[key]}&`
        }
        if (paramURL.length > 1) {
            return `${paramURL.substring(0, paramURL.length - 1)}`
        }
        paramURL = escape(encodeURI(paramURL));
        return paramURL;
    };
}

